//
//  UserInfoTool.h
//  DDViedo
//
//  Created by iwind on 15/3/25.
//  Copyright (c) 2015年 赵 冰冰. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>


/// 用户一级权限 Key
static NSString * const UP1 = @"1";

/// 用户二级权限 Key
static NSString * const UP2 = @"2";

/// 用户三级权限 Key
static NSString * const UP3 = @"3";

/// 用户四级权限 Key
static NSString * const UP4 = @"4";

/// 用户名
static NSString * const UserName = @"USER_NAME";

/// 用户 code
static NSString * const UserCode = @"USER_CODE";

/// 用户角色
static NSString * const UserRols = @"USER_ROLS";

/// 组织名称
static NSString * const OrgName = @"ORG_NAME";


@interface UserInfoTool : NSObject
//+ (NSString *)applyInfSureSign;
//+ (void)saveApplyInfSureSign:(NSString *)applyInfSure;
//
//
//+ (NSString *)loanInfSureSign;
//+ (void)saveLoanInfSureSign:(NSString *)LoanInfSure;

#pragma mark App Version
/**
 获取应用当前版本号

 @return 应用当前版本号
 */
+ (NSString *)currentAppVersion;
/**
 存储应用版本号

 @param appVersion 应用版本号
 */
+ (void)saveCurrentAppVersion:(NSString *)appVersion;

#pragma mark - Data Version
/**
 获取常量数据版本号

 @return 常量数据版本号
 */
+ (NSString *)getDataVersion;
/**
 存储常量数据版本号

 @param version 常量数据版本号
 */
+ (void)saveDataVersion:(NSString *)version;

+ (BOOL)firstLaunch;
/**
 保存首次加载应用的状态
 
 @param state 首次加载应用的状态
 */
+ (void)saveFirstLaunchState:(BOOL)state;

#pragma mark - First in Home View
/**
 首次进入首页
 
 @return 首次进入首页的状态
 */
+ (BOOL)firstInHomeView;
/**
 保存首次进入首页的状态
 
 @param state 首次进入首页的状态
 */
+ (void)saveFirstInHomeState:(BOOL)state;


#pragma mark - User Canuseca
+ (NSString *)getUserCanuseca;
+ (void)saveUserCanuseca:(NSString *)userCanuseca;

#pragma mark - User acclevel
+ (NSString*)getUserAcclevel;
+ (void)saveUserAcclevel:(NSString*)userAcclevel;

#pragma mark - User ID
+ (NSString *)getUserId;
+ (void)saveUserId:(NSString *)userId;

#pragma mark - Token
+ (NSString *)getToken;
+ (void)saveToken:(NSString *)token;

#pragma mark - User Name
+ (NSString *)getUserName;
+ (void)saveCurrentUserName:(NSString *)userName;

#pragma mark - User Code
+ (NSString *)getUserCode;
+ (void)saveCurrentUserCode:(NSString *)userCode;

#pragma mark - User Role
+ (NSArray<NSString *> *)getUserRoles;
+ (void)saveUserRoles:(NSArray<NSString *> *)userRoles;

#pragma mark - OrgName
+ (NSString *)getOrgName;
+ (void)saveOrgName:(NSString *)orgName;

+ (void)deleteToken;

#pragma mark - Addition Info
+ (NSArray *)addition;
+ (void)saveAddition:(NSArray *)addition;

#pragma mark - User Permission Info
/**
 获取用户权限信息

 @return 用户权限信息
 */
+ (NSDictionary *)userPermissionInfo;
/**
 存储用户权限信息

 @param info 用户权限信息
 */
+ (void)saveUserPermissionInfo:(NSDictionary *)info;

#pragma mark - New Car Permission
/**
 获取本品新车权限

 @return 本品新车权限
 */
+ (BOOL)newCarPermission;
/**
 保存本品新车权限

 @param permission 本品新车权限
 */
+ (void)saveNewCarPermission:(BOOL)permission;

#pragma mark - Second Hand Permission
/**
 获取二手车权限

 @return 二手车权限
 */
+ (BOOL)secondHandPermission;
/**
 保存二手车权限

 @param permission 二手车权限
 */
+ (void)saveSecondHandPermission:(BOOL)permission;

#pragma mark - Org Loan Permission
/**
 获取机构权限

 @return 机构权限
 */
+ (BOOL)orgLoanPermission;
/**
 保存机构权限

 @param permission 机构权限
 */
+ (void)saveOrgLoanPermission:(BOOL)permission;

#pragma mark - All Brand Permission
/**
 获取全品牌权限

 @return 全品牌权限
 */
+ (BOOL)allBrandPermission;
/**
 保存全品牌权限

 @param permission 全品牌权限
 */
+ (void)saveAllBrandPermission:(BOOL)permission;

#pragma mark -
/// 获取两个经纬度之间的距离
+ (CGFloat)getDintanceBylatitude:(CLLocationDegrees)latitude
                       Longitude:(CLLocationDegrees)longitude;

#pragma mark - Device ID
/**
 获取设备唯一识别码

 @return 设备唯一识别码
 */
+ (NSString *)getDeviceId;

#if DEBUG
/// 服务器环境
+ (NSInteger)serverType;

/// 保存服务器环境
+ (void)saveSerserType:(NSInteger)type;
#endif

@end
